package com.hisysteTopet.hisystepet.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hisysteTopet.hisystepet.bean.Foster;
import com.hisysteTopet.hisystepet.mapper.FosterMapper;
import com.hisysteTopet.hisystepet.service.FosterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FosterServiceImpl extends ServiceImpl<FosterMapper, Foster> implements FosterService {

    @Autowired
    FosterMapper fosterMapper;

    @Override
    public List<Foster> selectByUsername(String username) {
        return fosterMapper.selectByUsername(username);
    }

    @Override
    public void deleteByFosterId(String fosterId,String username) {
        fosterMapper.deleteByFosterId(fosterId,username);
    }

    @Override
    public void insertByFosterId(String username, String why, String data) {
        fosterMapper.insertByFosterId(username,why,data);
    }

    // 查询所有待审核的预约信息
    @Override
    public List<Foster> auditAllMessage(){
        return fosterMapper.auditAllMessage();
    }

    @Override
    public void updateFosterMessageByYes(String audit ,String auditResults,Integer fosterId) {
        fosterMapper.updateFosterMessageByYes(audit,auditResults,fosterId);
    }

    @Override
    public void updateFosterMessageByNo(String audit ,String auditResults,Integer fosterId) {
        fosterMapper.updateFosterMessageByNo(audit,auditResults,fosterId);
    }
}
